package com.cmc.cloud.cmclink.doc.api.document;

import com.cmc.cloud.cmclink.doc.api.document.rep.AgentContactBaseDto;
import com.cmc.cloud.cmclink.doc.api.document.req.AgentContactReqDto;
import com.cmc.cloud.cmclink.doc.convert.AgentContactConvert;
import com.cmc.cloud.cmclink.doc.service.AgentContactService;
import com.cmes.framework.common.pojo.CommonResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author lzp
 */
@RestController
@Validated
public class AgentContactApiImpl implements AgentContactApi {

    @Resource
    private AgentContactService agentContactService;

    @Override
    public CommonResult<List<AgentContactBaseDto>> personPage(AgentContactReqDto agentContactReqDto) {
        return CommonResult.success(agentContactService.agentContact(AgentContactConvert.INSTANCE.convertAgentContactReqDto(agentContactReqDto)));
    }
}
